<?php Yii::app()->publishAndRegisterScriptFile($_SERVER['DOCUMENT_ROOT'] . '/js/mustache.js', CClientScript::POS_HEAD); ?>
<?php Yii::app()->publishAndRegisterScriptFile($_SERVER['DOCUMENT_ROOT'] . '/js/jquery.ui.rotatable/jquery.ui.rotatable.js', CClientScript::POS_HEAD); ?>
<?php Yii::app()->publishAndRegisterCssFile($_SERVER['DOCUMENT_ROOT'] . '/js/jquery.ui.rotatable/jquery.ui.rotatable.css'); ?>
<?php Yii::app()->publishAndRegisterScriptFile($_SERVER['DOCUMENT_ROOT'] . '/js/jquery.ui.resizable.snap/jquery.ui.resizable.snap.ext.v1.7.min.js', CClientScript::POS_HEAD); ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::app()->basePath . '/javascripts/app.brochure.Widget.js', CClientScript::POS_HEAD); ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::app()->basePath . '/javascripts/app.brochure.widgets.Textbox.js', CClientScript::POS_HEAD); ?>
<?php Yii::app()->publishAndRegisterScriptFile(Yii::app()->basePath . '/javascripts/app.brochure.widgets.Image.js', CClientScript::POS_HEAD); ?>
<link href="/js/aloha/css/aloha.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/aloha/lib/aloha-full.js"
		data-aloha-plugins="common/ui,
		common/format,
		common/table,
		common/list,
		common/link,
		common/block,
		common/undo,
		common/contenthandler,
		common/paste,
		common/commands,
common/abbr"></script>
<script type="text/javascript">
	var templateId = <?php echo ($id ? $id : 'null'); ?>;
	var agencyLogo = "<?php echo Yii::app()->user->model->agency->getLogo(); ?>";
	<?php $imgSize = getimagesize($_SERVER['DOCUMENT_ROOT'] . Yii::app()->user->model->agency->getLogo()); ?>
	var agencyLogoWidth = <?php echo $imgSize[0]; ?>;
	var agencyLogoHeight = <?php echo $imgSize[1]; ?>;
</script>
<div id="wrapper">
	<div id="editor">
		<div class="header" contenteditable="false">Header</div>
		<div id="pages">
			<div class="overlay"></div>
			<div class="body">
				<div class="content"></div>
			</div>
		</div>
		<div class="footer" contenteditable="false">Footer</div>
	</div>
	<div id="toolbar"></div>
</div>